﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using Antu.WebControls;
using Antu.Core.Components;
using Antu.Core.Services;
using System.Web.UI.WebControls;
using EluZSProvider;
using System.Web;
using System.Data;

namespace WebSys.UI.Control.ZhengShou
{
    public class ZS_MessageContentControl : MPBasicTemplate
    {
        EluZSDataProvider _EluZSDataProvider = (EluZSDataProvider)ProviderService.ProviderServiceMange.GetProvider("EluZSProvider");
        public string userid = string.Empty;
        protected override void OnLoad(EventArgs e)
        {
            if (HttpContext.Current.Session["UserID"] == null)
            {
                Antu.Utilities.UtilitiesPage.AlertDialogClear("登录超时，请重新登录！", "window.parent.location.href('../login.aspx');");
            }
            else
            {
                userid = HttpContext.Current.Session["UserID"].ToString();
            }
            base.OnLoad(e);
            string strid = base.Page.Request["ID"];
            Label lblMESSAGETITLE = (Label)FindControl("lblMESSAGETITLE");
            Label lblMESSAGECONTENT = (Label)FindControl("lblMESSAGECONTENT");
            if (!base.Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(strid)) {
                    lblMESSAGETITLE.Text = _EluZSDataProvider.GetSomeStr("ZS_MESSAGE", "MESSAGETITLE", "id", strid);
                    lblMESSAGECONTENT.Text = _EluZSDataProvider.GetSomeStr("ZS_MESSAGE", "MESSAGECONTENT", "id", strid);
                    string t1 = _EluZSDataProvider.GetSomeStr("ZS_MESSAGE", "ISREAD", "id", strid);
                    if (t1 == "0") {
                        _EluZSDataProvider.UpdateBSZT("ZS_MESSAGE", "ISREAD", "1", "id", strid);
                    }
                }
            }
        }
    }
}


